<template>
    <div>
		<div class="input_groud">
			<el-input v-model="username" placeholder="请输入用户名"></el-input>
		</div>
		<div class="input_groud">
			<el-input v-model="password" placeholder="请输入密码" type="password"></el-input>
		</div>
		<div class="input_groud">
			<el-input v-model="secPassword" placeholder="请再次输入密码" type="password"></el-input>
		</div>
		<div class="btns">
			<el-button type="primary" @click="confirm">确定</el-button>
			<el-button type="danger" @click="cancel">取消</el-button>
		</div>
	</div>
</template>
<script>
export default {
    data() {
        return {
			username: '',
			password: '',
			secPassword: ''
		};
    },
    created() {},
    mounted() {},
    methods: {
		confirm(){
			if(!(this.username && this.password && this.secPassword)){
				this.$message.warning('请填写相关信息')
				return
			}
			if(this.password !== this.secPassword){
				this.$message.warning('两次密码不一样')
				return 
			}
			let url = api + 'user/register';
			let data = {
				username: this.username,
				password: this.password
			}
			this.$axios.post(url, data).then(res => {
				console.log(res)
			})
		},
		cancel(){

		}
	},
    filters: {},
    components: {}
};
</script>

<style lang="less" scope>
@import "./index.less";
</style>
